<template>
    <div class="container">
        <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
            <van-swipe-item v-for="item in bannerList">
                <van-image fit="contain" style="width: 100%;height: 200px;"
                 :src="item.img" />
            </van-swipe-item>
        </van-swipe>
    </div>
</template>

<script>
export default {
    //方式一
    // props:{
    //     bannerList:Array,
    //     default:[]
    // }
    //方式二
    props: ['bannerList']

}
</script>

<style lang="less" scoped>
.container{
    height: 200px;
}
.my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    text-align: center;
    background-color: #39a9ed;
}
</style>
<!-- 需要引用轮播时，在HomeView.vue中引入
 <LunboCom :bannerList="bannerList"></LunboCom> -->